package cn.butcher21.controller;

import cn.butcher21.dao.DaoWork;
import cn.butcher21.dao.DaoWorkImpl.DaoWorkImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

/**
 * butcher create in 2021/04/10/21:53
 */
@WebServlet("/complete")
public class CompleteServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        DaoWork daoWork = new DaoWorkImpl();
        try {
            daoWork.complete(id);
        } catch (SQLException e) {
            e.printStackTrace();
            response.setStatus(500);
        }
    }
}
